<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
		.box{
			width: 100px;
			height: 100px;
			background-color: #004F00;
			position: absolute;
			top: 100px;
			left: 0px;
			padding: 10px;
			border: 200px solid red;
			
		}
		</style>
	</head>
	<body>
		<div class="box"></div>
		<button type="button">run</button>
		<script>
		var obox=document.getElementsByClassName('box')[0];
		var btn=document.getElementsByTagName('button')[0];
			
		btn.onclick=function(){
			var timer=setInterval(function(){
				obox.style.left=obox.offsetLeft+10+'px';
			},30);
		}
		</script>
	</body>
</html>
